package com.zz.springboot.initializer;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.context.annotation.Configuration;

import java.util.*;

@Configuration
public class DataInitializer implements InitializingBean {

    public static Map<String, List<Integer>> animal_Map = new HashMap();

    public static Map<String, List<Integer>> odds_evens_Map = new HashMap<>();

    public static Map<String, List<Integer>> bigLittle_Map = new HashMap<>();

    public static Map<String, List<Integer>> bigLittle_oddsEvens_Map = new HashMap<>();

    public static Map<String, List<Integer>> color_Map = new HashMap<>();

    public static Map<String, List<Integer>> digits_Map = new HashMap<>();

    @Override
    public void afterPropertiesSet() {
        // 生肖
        animal_Map.put("兔", Arrays.asList(3, 15, 27, 39));
        animal_Map.put("虎", Arrays.asList(4, 16, 28, 40));
        animal_Map.put("牛", Arrays.asList(5, 17, 29, 41));
        animal_Map.put("鼠", Arrays.asList(6, 18, 30, 42));
        animal_Map.put("猪", Arrays.asList(7, 19, 31, 43));
        animal_Map.put("狗", Arrays.asList(8, 20, 32, 44));
        animal_Map.put("鸡", Arrays.asList(9, 21, 33, 45));
        animal_Map.put("猴", Arrays.asList(10, 22, 34, 46));
        animal_Map.put("羊", Arrays.asList(11, 23, 35, 47));
        animal_Map.put("马", Arrays.asList(12, 24, 36, 48));
        animal_Map.put("蛇", Arrays.asList(1, 13, 25, 37, 49));
        animal_Map.put("龙", Arrays.asList(2, 14, 26, 38));

        //单双
        odds_evens_Map.put("单", Arrays.asList(1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41, 43, 45, 47, 49));
        odds_evens_Map.put("双", Arrays.asList(2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48));

        //大小：
        bigLittle_Map.put("小", Arrays.asList(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24));
        bigLittle_Map.put("大", Arrays.asList(25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49));

        //大小&单双：大单、小单、大双、小双
        bigLittle_oddsEvens_Map.put("小单", Arrays.asList(1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23));
        bigLittle_oddsEvens_Map.put("小双", Arrays.asList(2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24));
        bigLittle_oddsEvens_Map.put("大单", Arrays.asList(25, 27, 29, 31, 33, 35, 37, 39, 41, 43, 45, 47, 49));
        bigLittle_oddsEvens_Map.put("大双", Arrays.asList(26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48));

        //波色：红绿蓝
        color_Map.put("红波", Arrays.asList(1, 2, 7, 8, 12, 13, 18, 19, 23, 24, 29, 30, 34, 35, 40, 45, 46));
        color_Map.put("绿波", Arrays.asList(5, 6, 11, 16, 17, 21, 22, 27, 28, 32, 33, 38, 39, 43, 44, 49));
        color_Map.put("蓝波", Arrays.asList(3, 4, 9, 10, 14, 15, 20, 25, 26, 31, 36, 37, 41, 42, 47, 48));

        //尾数
        digits_Map.put("0", Arrays.asList(10, 20, 30, 40));
        digits_Map.put("1", Arrays.asList(1, 11, 21, 31, 41));
        digits_Map.put("2", Arrays.asList(2, 12, 22, 32, 43));
        digits_Map.put("3", Arrays.asList(3, 13, 23, 33, 43));
        digits_Map.put("4", Arrays.asList(4, 14, 24, 34, 44));
        digits_Map.put("5", Arrays.asList(5, 15, 25, 35, 45));
        digits_Map.put("6", Arrays.asList(6, 16, 26, 36, 46));
        digits_Map.put("7", Arrays.asList(7, 17, 27, 37, 47));
        digits_Map.put("8", Arrays.asList(8, 18, 28, 38, 48));
        digits_Map.put("9", Arrays.asList(9, 19, 29, 39, 49));

    }

    public static Map<String, List<Integer>> getAnimalMap() {
        return animal_Map;
    }

    public static Map<String, List<Integer>> getOddsEvensMap() {
        return odds_evens_Map;
    }


    public static Map<String, List<Integer>> getBigLittleMap() {
        return bigLittle_Map;
    }

    public static Map<String, List<Integer>> getBigLittleOddEvenMap() {
        return bigLittle_oddsEvens_Map;
    }

    public static Map<String, List<Integer>> getClolorsMap() {
        return color_Map;
    }

    public static Map<String, List<Integer>> getDigitsMap() {
        return digits_Map;
    }

}
